package Q_Learning;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class LearnListener implements ActionListener {

	@Override
	public void actionPerformed(ActionEvent e) {
		double alpha = 0.5, gamma = 0.5, rand = 0.5;
		int step = 100;
		Agent Robot = MainQLearning.Robot;
		
		alpha = MainQLearning.inst.getParameter(0);
		gamma = MainQLearning.inst.getParameter(1);
		rand = MainQLearning.inst.getParameter(2);
		step = MainQLearning.inst.getStep(3);
		
		Robot.setAlpha(alpha);
		Robot.setGamma(gamma);
		Robot.setRandom(rand);
		
		Robot.learn(step);
	}

}
